/**
 * 对商城主组进行界面视图进行初始判断
 */
var WindowUtils={
  getWindowSize:function(){
    return window.screen.width;
  },
  getDomain:function(url){
    url=url||window.location.href;
    var host="null";
    if(typeof url=="undefined"||null==url)
      url=window.location.href;
    var regex=/.*\:\/\/([^\/]*).*/;
    var match=url.match(regex);
    if(typeof match!="undefined"&&null!=match)
      host=match[1];
    return host;
  },
  initWindowSize:function(){
    // 如果显示器为狭屏时
    var cookieObj=Utils.getCookie("ccb-css");
    var windwoSize=WindowUtils.getWindowSize();
    var cssContent=windwoSize<=1024?"narrow":"wide";
    if(cookieObj!=cssContent){
      Utils.loadingMsg("正在调整浏览器分辨，请稍候...");
      Utils.setCookie("ccb-css",cssContent,0,this.getDomain());
      window.parent.location.reload();
      $.jBox.closeTip();
    }
  }
};